#pragma once

#ifndef LEVELMANAGER_H
#define LEVELMANAGER_H

#include <hash_map>
#include <d3d9.h>
#include <d3dx9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include "Level.h"
#include "Game.h"

class LevelManager
{
private:
	static int nextID;
	static int currentID;
	static std::hash_map<int, Level*> levels;
	LevelManager() { }
	~LevelManager();
	static LevelManager* instance;
public:
	static void init();
	static void draw(ID3DXSprite* sprite);
	static void registerLevel(Level* level);
	static void removeLevel(Level* level);
	static void setCurrentID(int newCurrentID) { currentID = newCurrentID; }
	static int getCurrentID() { return currentID; }
	static int getLastID() { return levels.end()->first; }
	static Level* getCurrentLevel() { return getLevel(currentID); }
	static Level* getLevel(int id);
	static bool levelExists(int id);
};

#endif